<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:directive.page import="com.anhry.app.safety.util.Util"/>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>菜单编辑</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath+Util.SKIN%>/css/right.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/check_jquery.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/multipleBox.js"></script>
	<script type="text/javascript">		
		function checkMultiple(){
			var dbfile=document.getElementById("dbFile");
			if(dbfile.value==null||dbfile.value==""){
				alert("请点击“浏览”上传Excel附件！");
				dbfile.focus();
				return false;
			}
			var selectBox = document.getElementById('haveSelect');
			var haveSelect = "";
			if(selectBox.options != null && selectBox.options.length != 0){
				for(var i=0;i<selectBox.options.length;i++){
					var tKey = selectBox.options[i].value;
					haveSelect += tKey + ","; 					
				}
				if(haveSelect.length>0){
					haveSelect = haveSelect.substring(0,haveSelect.length-1);
				}
			}
			document.form1.objIds.value=haveSelect;
		}
	</script>
  </head>
  
  <body>
	<div  class="body-box">
		<div class="map">
			<div class="map_con">
				您当前的位置：自查自报 &gt; 隐患排查标准管理 &gt; 隐患排查标准导入
			</div>
		</div>
		<div id="container">
			<form action="<%=basePath%>/zczb/bzh_save.action" method="post" name="form1" onsubmit="return checkMultiple();"  enctype="multipart/form-data">
		    	<table border="0" cellspacing="0" cellpadding="0"  width="100%" class="info_table">
					<tr>
						<td colspan="2" class="title_li">隐患排查标准导入</td>
					</tr>
					<tr>
						<td class="title_td" width="15%">标准名称</td>
						<td>${tab.tabName }</td>
					</tr>
					<tr>
						<td class="title_td" width="15%">附件：</td>
						<td>
							<input type="file" name="dbFile" id="dbFile" onkeypress="return false;"><span style="color: gray">只能上传excel格式！</span>
						</td>
					</tr>
					<tr>
						<td class="title_td">对应企业类型：</td>
							<td>
								<table border="0" cellspacing="0" cellpadding="0"  width="100%"  style="float:left;">
								<tr>
									<td width="45%" style="border:none">
									  所有企业类型：<br>
										 <table width="99%" height="200" border="0" cellpadding="1" cellspacing="0" bgcolor="#F7F7F7" style="font-size:10pt">
											  <tr height="100%">
												<td width="100%" height="100%" align="left" valign="middle">
													<select style="width:100%;height:100%" name="allSelect" size="17" ondblclick="selectMove(document.form1.allSelect,document.form1.haveSelect,'左')">																		                                      	
				                                    	<s:if test="typeList.size>0">
					                                    	<s:iterator id="obj" value="typeList">
					                                      		<option value="${obj.id }">
					                                      			${obj.typeParentName }——${obj.typeName}
					                                      		</option>	
					                                      	</s:iterator>
				                                      	</s:if>
				                                    </select>
			                                    </td>
											  </tr>
										</table>
									</td>
									<td width="10%" style="text-align:center;border-top:none;border-bottom:none;"><br>
								    <a href="javascript:selectMove(document.form1.allSelect,document.form1.haveSelect,'左')">添加</a><br>
								    <a href="javascript:selectMove(document.form1.haveSelect,document.form1.allSelect,'右')">删除</a><br>
								    <a href="javascript:moveAll(document.form1.allSelect,document.form1.haveSelect);">全部添加</a><br>
								    <a href="javascript:moveAll(document.form1.haveSelect,document.form1.allSelect);">全部删除</a></td>
									<td width="45%" style="border:none">
									  对应企业类型：<br>
										 <table width="99%" height="200" border="0" cellpadding="1" cellspacing="0" bgcolor="#F7F7F7" style="font-size:10pt">
											  <tr height="100%">
												<td width="100%" height="100%" align="left" valign="middle">
													<select id="haveSelect" style="width:100%;height:100%" name="haveSelect" size="17" ondblclick="selectMove(document.form1.haveSelect,document.form1.allSelect,'右')" >											                                     
				                                    	<s:if test="haveList.size>0">
					                                    	<s:iterator id="obj" value="haveList">
					                                      		<option value="${obj.id }">
					                                      			${obj.typeParentName }——${obj.typeName}
					                                      		</option>	
					                                      	</s:iterator>
				                                      	</s:if>
				                                    </select>
			                                    </td>
											  </tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td colspan="4" align="center">
							<center>
							<input type="submit" name="btntj" class="link_input" id="btnSubmit" value="提 交">
							<input type="button" name="btn1" class="link_input" id="btnset1" value="返 回" onclick="window.location.href='<%=basePath%>/zczb/bzh_list.action?keyWord=${keyWord }&num=${num }&size=${size }'">
							</center>
						</td>
					</tr>
				</table>
				<input type="hidden" name="objIds" value=""/>
				<input type="hidden" name="objId" value="${tab.id }"/>
				<input type="hidden" name="keyWord" value="${keyWord }"/>
				<input type="hidden" name="num" value="${num }"/>
				<input type="hidden" name="size" value="${size }"/>
			</form>
		</div>
	</div>
  </body>
  <s:if test="%{tip!=null}">
    	<script>
    		alert('${tip}');
    	</script>
    </s:if>
</html>
